SET(HEADERS "")
SET(SOURCES "")

TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.hpp)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
SET(HEADERS ${HEADERS}
  ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.hpp
  )

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/disc)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lof)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/evaluators)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/responses)
IF(Panzer_BUILD_PAPI_SUPPORT)
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/papi)
ENDIF()

# auto generate headers, add to dependencies and include directories
TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${CMAKE_CURRENT_SOURCE_DIR})
TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${CMAKE_CURRENT_SOURCE_DIR}/lof)
TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${CMAKE_CURRENT_SOURCE_DIR}/evaluators)
TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${CMAKE_CURRENT_SOURCE_DIR}/responses)
IF(Panzer_BUILD_PAPI_SUPPORT)
  TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${CMAKE_CURRENT_SOURCE_DIR}/papi)
ENDIF()
APPEND_GLOB(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/*.hpp)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

APPEND_GLOB(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
APPEND_GLOB(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/disc/*.hpp)
APPEND_GLOB(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/lof/*.hpp)
APPEND_GLOB(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/*.hpp)
APPEND_GLOB(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/responses/*.hpp)
IF(Panzer_BUILD_PAPI_SUPPORT)
  APPEND_GLOB(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/papi/*.hpp)
ENDIF()

APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/lof/*.cpp)
APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/*.cpp)
APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/responses/*.cpp)
IF(Panzer_BUILD_PAPI_SUPPORT)
  APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/papi/*.cpp)
ENDIF()

IF(NOT PANZER_HAVE_EPETRA)
  LIST(REMOVE_ITEM SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/Panzer_BlockedVector_Write_GlobalEvaluationData.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/Panzer_EpetraVector_ReadOnly_GlobalEvaluationData.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/Panzer_EpetraVector_Write_GlobalEvaluationData.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/Panzer_ModelEvaluator_Epetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_GatherSolution_BlockedEpetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_GatherSolution_Epetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_GatherTangent_BlockedEpetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_GatherTangent_Epetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_ScatterDirichletResidual_BlockedEpetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_ScatterDirichletResidual_Epetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_ScatterResidual_BlockedEpetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/evaluators/Panzer_ScatterResidual_Epetra.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/lof/Panzer_BlockedEpetraLinearObjContainer.cpp
    ${CMAKE_CURRENT_SOURCE_DIR}/lof/Panzer_BlockedEpetraLinearObjFactory.cpp
  )
ENDIF()

#
# C) Define the targets for package's library(s)
#

TRIBITS_ADD_LIBRARY(
  panzer-disc-fe
  HEADERS ${HEADERS}
  SOURCES ${SOURCES}
  )

